#!/bin/sh

DEPS_DIR=${1}
if [ -z "${DEPS_DIR}" ]; then
    DEPS_DIR=${CUR_DIR}/../
fi

CUR_DIR=$(pwd)

cd $DEPS_DIR

mkdir -pv jsoncpp/build
cd jsoncpp/build
cmake ..
make -j
cd ../../

mkdir -pv surbasic/build
cd surbasic/build
cmake ..
make -j
cd ../../

mkdir -pv onion/build
cd onion/build
cmake ../
make -j
cd ../../

cd $CUR_DIR
